def letters(str):
    ss=''
    for i in str:
        if i.isalpha():
            ss +=i
    print(ss)
    return ss

def reverse(ss1):
    result = ss1[::-1]
    print(result)

if __name__ == '__main__':
    str1=input("请输入一行字符串：")
    newstr = letters(str1)

    reverse(newstr)